import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css' // 引入样式文件
import './styles/global.css' // 引入全局样式文件
import * as Icons from '@element-plus/icons-vue'
import router from './router'
import store from './store'
import LoadingPage from '@/views/common/LoadingPage.vue'

/* WebPack 定义特性标志 */
window.__VUE_OPTIONS_API__ = true // 只使用 Composition API
window.__VUE_PROD_DEVTOOLS__ = false // 避免暴露敏感信息
window.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false //减少包体积

const app = createApp(App)
// 禁用所有 Vue 警告
app.config.warnHandler = () =>
{}
app.config.silent = true

app.component('LoadingPage', LoadingPage)
app.use(store)
app.use(router)
app.use(ElementPlus)

// 注册所有图标组件
for (const [key, component] of Object.entries(Icons))
  app.component(key, component)

app.mount('#app')
